package com.todoapp;

import org.apache.wicket.protocol.http.WebApplication;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import todo.core.bso.TodoService;

import com.todoapp.page.HomePage;


/**
 * Application object for the web application. 
 */
public class WicketApplication extends WebApplication {    
	// TODO: fix this so that the config is specified in the web.xml, not here
	private static ClassPathXmlApplicationContext factory = new ClassPathXmlApplicationContext("example-applicationContext.xml");
	
	/**
     * Constructor
     */
	public WicketApplication()	{
	}
	
	/**
	 * @see org.apache.wicket.Application#getHomePage()
	 */
	public Class<HomePage> getHomePage()
	{
		return HomePage.class;
	}

	public TodoService getTodoService() {
		return (TodoService) factory.getBean("todoService");
	}

}
